"""
Task 2

Input data:

stock = {
    "banana": 6,
    "apple": 0,
    "orange": 32,
    "pear": 15
}
prices = {
    "banana": 4,
    "apple": 2,
    "orange": 1.5,
    "pear": 3
}


Compute the total price of the stock where the total price is the sum of the 
price of an item multiplied by the quantity of this exact item.
"""

stock = {
    "banana": 6,
    "apple": 0,
    "orange": 32,
    "pear": 15,
    "eggs": 9,
    "potato": 0}
prices = {
    "banana": 4,
    "apple": 2,
    "orange": 1.5,
    "pear": 3,
    "potato": 10
}
intersection_keys = list(set(stock.keys()).intersection(prices))
sum = 0
for key in intersection_keys:
    sum += stock.get(key) * prices.get(key)
print(f"total price is {sum}")
